<?php

    require '../vendor/autoload.php';

    $hosts = [
        '101.132.73.77:9200' // ip和端口
    ];

    $client = Elasticsearch\ClientBuilder::create()
                                ->setHosts($hosts)
                                ->build();
$params = [
    'index' => 'two',
    'body' => [
        'settings' => [
            'number_of_shards' => 2,
            'number_of_replicas' => 0
        ]
    ]
];

$response = $client->indices()->create($params);
print_r($response);
